package com.qianfeng.zhangwei.volley;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;

public class MainActivity extends AppCompatActivity {
    @ViewInject(R.id.text_xutils)private TextView textView;
    @ViewInject(R.id.img_xutils)private ImageView imageView;
    @ViewInject(R.id.bt_xutils)private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ViewUtils.inject(this);
        textView.setText("天天果园");
        imageView.setImageResource(R.mipmap.c3);
        button.setText("开始");
        getSupportFragmentManager().beginTransaction().add(R.id.contaner,new UtilsFragment()).commit();
    }
    @OnClick({R.id.img_xutils,R.id.bt_xutils})
    private void start(View view){
        switch (view.getId()){
            case R.id.img_xutils:
                Toast.makeText(this,"你好",Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_xutils:
                Toast.makeText(this,"Hellow Work",Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
